//
//  timeModel.m
//  theCoupleLive
//
//  Created by USER on 2016/12/7.
//  Copyright © 2016年 USER. All rights reserved.
//

#import "timeModel.h"

@implementation timeModel

#pragma mark 分钟model
+(id)timeAgoWithtime:(NSString *)time{
    int t=[time intValue];
    if (t<60) {
        return [NSString stringWithFormat:@"%d分钟前",t];
    }
    else if (t<1440){
        return [NSString stringWithFormat:@"%d小时前",t/60];
    }
    else if (t<4320){
        return [NSString stringWithFormat:@"%d天前",t/1440];
    }
    else {
        return [NSString stringWithFormat:@"3天前"];
    }
}

#pragma mark  转化秒model
+(id)secondAgoWithTime:(NSString *)time{
    int t=[time intValue];
    if (t<3600) {
        return [NSString stringWithFormat:@"%d分钟前",t/60];
    }
    else if (t<1440*60){
        return [NSString stringWithFormat:@"%d小时前",t/3600];
    }
    else if (t<4320*60*7){
        return [NSString stringWithFormat:@"%d天前",t/86400];
    }
    else {
        return [NSString stringWithFormat:@"7天前"];
    }
}

@end
